# coding:utf8

import requests

'''
from https://coding.imooc.com/lesson/62.html#mid=820
慕课网视频
...
接口返回值有变化，代码未完成
city需要传入中文,比如 `http://wthrcdn.etouch.cn/weather_mini?city=深圳`
'''


def get_weather(city):
    r = requests.get(u'http://wthrcdn.etouch.cn/weather_mini?city=' + city)
    data = r.json()['data']['forecast'][0]
    return '%s: %s , %s ' % (city, data['low'], data['high'])
